package com.qingcloud.adminbackend.entity.message;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 事件计算比较信息
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_message_event_cal_compare")
public class SysMessageEventCalCompare extends Model {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "计算规则ID", hidden = true)
    private Integer ruleId;

    @ApiModelProperty(value = "计算字段名")
    @NotBlank(message = "计算类型字段不能为空")
    private String fieldName;

    @ApiModelProperty(value = "结果类型")
    @NotBlank(message = "计算结果类型不能为空")
    private String resultType;

    @ApiModelProperty(value = "比较类型")
    @NotBlank(message = "计算比较类型不能为空")
    private String compareType;

    @ApiModelProperty(value = "比较阈值")
    @NotNull(message = "计算阈值不能为空")
    private Float compareValue;

    @ApiModelProperty(value = "逻辑类型")
    private String logicType;

}
